unit_threaded.mock

Support the automatic implementation of test doubles via programmable mocks.

Members

Functions

mock
auto mock()

Helper function for creating a Mock object.

mockStruct
auto mockStruct(auto ref T returns)

Version of mockStruct that accepts 0 or more values of the same type. Whatever function is called on it, these values will be returned one by one. The limitation is that if more than one function is called on the mock, they all return the same type

mockStruct
auto mockStruct()

Version of mockStruct that accepts a compile-time mapping of function name to return values. Each template parameter must be a value of type ReturnValues

throwStruct
auto throwStruct()

A mock struct that always throws.

Structs

Mock
struct Mock(T)

A mock object that conforms to an interface/class.

Meta